package com.example.routeplansystem.entity.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;


/**
 * 节点实体类
 */

@Data
@ApiModel
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class NodeRes {

    @ApiModelProperty("点Id")
    private Integer nodeId;

    @ApiModelProperty("用户Id")
    private Integer userId;

    @ApiModelProperty("客户Id")
    private Integer clientId;

    @ApiModelProperty("点名称")
    private String nodeName;

    @ApiModelProperty("点详细地址")
    private String nodeAddress;

    @ApiModelProperty("纬度")
    private Double lat;

    @ApiModelProperty("经度")
    private Double lng;

    @ApiModelProperty("是否中心点")
    private Integer isCenter;

    @ApiModelProperty("删除标志")
    private Integer delFlag;

    @ApiModelProperty("点对应的需求量,默认为0")
    private Float demand = new Float(0);

    public NodeRes(NodePojo node, QuestionNodePojo q) {
        this.nodeId = node.getNodeId();
        this.userId = node.getUserId();
        this.clientId = node.getClientId();
        this.nodeName = node.getNodeName();
        this.nodeAddress = node.getNodeAddress();
        this.lat = node.getLat();
        this.lng = node.getLng();
        this.isCenter = q.getIsCenter();
        this.demand = q.getDemand();
        this.delFlag = node.getDelFlag();
    }
}
